home *** CD-ROM | disk | FTP | other *** search
Text File | 1985-03-18 | 40.9 KB | 1,621 lines |
- ¢@¢B
-
-
-
-
-
-
- Programmer's Calculator
-
- Version 1.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Copyright 1983
- Ronald Moak
- Forest Computer Consultants
- P.O. Box 1463
- Springfield, Oregon 97477
- All rights reserved
-
-
-
-
-
-
-
-
- TABLE OF CONTENTS
-
- STARTING UP
- INTRODUCTION . . . . . . . . . . .1
- SYSTEM REQUIREMENTS. . . . . . . .2
- BACK UP. . . . . . . . . . . . . .2
- STARTING & ENDING. . . . . . . . .3
- MONITORS . . . . . . . . . . . . .3
-
- CALCULATOR PROGRAM
- KEYING IN NUMBERS. . . . . . . . .4
- CORRECTING NUMBERS . . . . . . . .5
- REVERSE POLISH NOTATION. . . . . .5
- REGISTERS. . . . . . . . . . . . .6
- CALCULATIONS
- Single Register . . . . . . . .6
- Dual Register . . . . . . . . .7
- Chain Calculation . . . . . . .9
- FUNCTIONS. . . . . . . . . . . . .11
- General . . . . . . . . . . . .12
- Logical . . . . . . . . . . . .14
- Memory. . . . . . . . . . . . .16
- Stack . . . . . . . . . . . . .17
- MEMORY
- Store . . . . . . . . . . . . .18
- Recall. . . . . . . . . . . . .19
- Arithmetic. . . . . . . . . . .19
- Memory Display. . . . . . . . .20
- Clear Memory. . . . . . . . . .21
- STACK OPERATIONS
- Push. . . . . . . . . . . . . .21
- Pop . . . . . . . . . . . . . .23
- Clear Stack . . . . . . . . . .24
- STACK MANIPULATION
- Rotate Stack. . . . . . . . . .25
- Swap X & Y. . . . . . . . . . .26
- CONSTANT CALCULATIONS. . . . . . .26
- RANGES . . . . . . . . . . . . . .27
- ERRORS MESSAGES. . . . . . . . . .28
-
-
-
-
-
-
-
- CONVERSION PROGRAM
- NUMBER FORMAT & RANGE. . . . . . .29
- CONVERTING . . . . . . . . . . . .30
- 2'S COMPLEMENT . . . . . . . . . .31
- ERRORS . . . . . . . . . . . . . .32
- PROMPTS. . . . . . . . . . . . . .32
-
-
-
-
-
- Programmer's Calculator Page 1
-
-
- STARTING UP
-
-
- INTRODUCTION
-
- Programmer's Calculator is divided into
- two programs, Calculator and Conversion.
- After the initial screen the first screen
- displayed is the calculator program. To
- access the Conversion program screen use
- the function key (F10). This key is used
- to toggle between the two programs. When
- switching between programs, the program
- you leave is frozen at the point you
- pressed (F10). This allows you to return
- to the program where you left off.
-
- The Calculator Program is a powerful
- Reverse Polish Notation calculator. The
- calculator displays on screen the four
- stack registers, six memory registers and
- a display register; there by making it
- unnecessary to write down the contents of
- the registers when making complex calcula-
- tions. In addition to the general funct-
- ions found on most calculators the Pro-
- grammer's Calculator has six logical
- functions (and, or, not, etc.). Numbers
- used in the general calculations may be up
- to 16 digits in accuracy.
-
- The Conversion Program provides a
- fast and efficient way to convert numbers
- between decimal, hexadecimal, binary, and
- octal. Numbers up to 20 bits binary may be
- converted and the two's complement may be
- calculated on numbers up to 15 bits in
- length.
-
-
-
-
-
-
-
-
- Programmer's Calculator Page 2
-
-
- SYSTEM REQUIREMENTS
-
- Programmer's Calculator requires the
- following minimum requirements to operate.
-
- IBM Personal Computer
- 128K ram memory
- 1 disk drive
-
-
- BACK UP
-
- Before working with the Programmer's
- Calculator copy the program onto another
- disk and save the Master Disk in a safe
- place. You may copy Programmer's Calcula-
- tor onto a hard disk for rapid access, or
- on any disk you may need for your personal
- work.
-
- This program is copyrighted and selling
- of the program for personal gain is
- strictly prohibited. Because this program
- is marked under the concept of Freeware
- you may copy the program for distribut-
- ion. If you find this program to be of
- use to you the author recommends a $15.00
- donation. Further versions may become
- available if there is sufficient response.
-
- If you put the program on a fresh disk
- then format the new disk using the format
- instructions in the IBM DOS manual.
-
- Copy Procedure Single Drive:
- a. Insert Master Disk in Drive A
- b. Type: copy PC.EXE b:
- c. Read prompt, remove Master Disk and
- insert Backup disk and press any
- key.
-
-
-
-
-
- Programmer's Calculator Page 3
-
-
- Copy Procedure Dual Drive:
- a. Insert Master Disk in Drive A and
- insert Backup Disk in Drive B.
- b. Type: copy PC.EXE b:
-
- With the program safely copied store
- Master Disk in a safe place for protection
- in case your backup is damaged.
-
-
- STARTING & ENDING
-
- To run the program place a disk with
- the program on it and type PC. After a
- few seconds the opening screen will be
- displayed. Once the program is initialize
- the calculator screen will automatically
- replace the initial screen. If for some
- reason the program does not start, get the
- master disk out. The Master Disk comes
- with PC.EXE (Programmers Calculator),
- GC.EXE (General Calculator), PCMANUAL.TXT
- (program manual), and MANUAL.BAT (used to
- generate a copy of the manual).
-
- To end the program and return to DOS
- press the ESC key.
-
-
- MONITORS
-
- Programmer's Calculator will run on
- either the color/graphics card or the
- monochrome card. During the initialization
- process the program checks for the type of
- card installed and runs accordingly. If both
- monitors are installed the program defaults to
- the Color/Graphics Card.
-
-
-
-
-
-
- Programmer's Calculator Page 4
-
-
- CALCULATOR PROGRAM
-
- KEYING IN NUMBERS
-
- All numbers entered into the calculator
- program appear in the double boxed display
- under the stack.
-
- Positive Numbers: Key in the number as it
- is written but do not include the commas.
- Numbers will aligned on the left hand side
- of the display, and may be up to 16 digits
- long including the decimal place.
-
- Example: Enter the Number 1,345,776.732
-
- Keystroke Display
- 1345776.732 1,345,776.732
-
- Negative Numbers: To enter a negative
- number, key in the number as above then
- press F4. A minus sign will appear in
- front of the number.
-
- Example: Enter the number -123.4
-
- Keystroke Display
- 123.4 (F4) -123.4
-
- Press F4 again and the number will
- become positive. The key (F4) acts as a
- toggle between positive and negative
- numbers.
-
- Before continuing to the next section,
- press the tab key (|<-) and the back space
- key (<--). These keys will clear the
- stack and display registers respectively.
-
-
-
-
-
-
-
- Programmer's Calculator Page 5
-
-
- CORRECTING NUMBERS
-
- Single digit: If, during the process of
- entering a long number, you entered a
- digit incorrectly, you may correct the
- entry. Press (^) and the (Del) key simul-
- taneously and the last digit entered will
- be deleted. By repeating the keystroke
- and you may delete as many digits as
- needed.
-
- Example: If you entered 12,456.3 but
- meant to enter 1,245.63
-
- Keystroke Display
- 12456.3 12,456.3
- (^)(Del) 12,456.
- (^)(Del) 12,456
- (^)(Del) 1,245
- .63 1,245.63
-
- Whole numbers: To delete the entire number
- press the Backspace key (<--). This clears
- the number in the display and pops the
- stack (see Stack Operations). To enter a
- new number just enter the number as you
- would normally.
-
- Example: You typed 239 but meant to type
- .239.
-
- Keystroke Display Stack 1
- 239 239 0.
- (<) 0. 0.
- .239 .239 0.
-
-
- REVERSE POLISH NOTATION
-
- The Programmers Calculator uses Reverse
- Polish Notation (RPN) logic in the calcu-
-
-
-
-
-
- Programmer's Calculator Page 6
-
-
- lation of numbers. RPN is a fast and
- efficient method for long calculations, but
- may take some getting used to if you are
- new to the logic. If you have never
- worked with a RPN calculator, read this
- manual carefully to take full advantage
- of the power of the calculator. If you
- have used used RPN logic on other calcu-
- lators, this system will be very familiar
- to you.
-
-
- REGISTERS
-
- In order for a calculator or computer
- to perform calculations it must store the
- numbers it is working on. In general this
- space is called memory. The Programmer's
- Calculator divides the memory into
- registers. Each register will hold one 16
- digit number. Programmer's Calculator has
- 11 registers displayed on the screen (6
- memory, 4 stack, 1 display). All primary
- operations (add, subtract, square root,
- etc) involve the display register (the
- double boxed register under the stack) by
- itself, or the display register with
- either one of the memory registers or the
- stack 1 register [S1]. Functions that use
- the display register alone are referred
- to as single register functions.
- Functions the require the use of two
- registers are referred to as dual register
- functions.
-
- CALCULATIONS
-
- Single Register Functions
-
- The single register function uses the
- value in the display register as input for
- the calculation. The result is placed
-
-
-
-
-
- Programmer's Calculator Page 7
-
-
- back in the display register, and no other
- registers are effected. An example of a
- single register function is the change
- sign function described in entering negat-
- ive numbers. Other single register funct-
- ions include square root, square, absolute
- value, logical not, etc.
-
- Single register functions are performed
- by:
- a. Entering the number
- b. Pressing the appropriate function
- key
-
- Example: Take the square root of 25
-
- Keystroke Display
- 25 25
- (F3) 5
-
-
- Dual Register Functions
-
- Dual register function make use of two
- registers. One register is always the
- display register the other register is
- either the stack 1 register or one of the
- memory registers. Most of the operations
- made on the calculator (add, subtract)
- require two numbers. RPN logic calculat-
- ors use the stack as a temporary storage
- for one of the numbers.
-
- In RPN logic the two numbers are
- entered into the calculator then the
- operation is performed. This will seem
- awkward a first, but a little experience
- will illustrate the power of the logic.
- In order for the calculator to different-
- ate between the two numbers the enter key
-
-
-
-
-
- Programmer's Calculator Page 8
-
-
- (<-') is pressed after the first number is
- entered. In effect the (<-') is used to
- push numbers on the stack where they are
- held in temporary storage until needed.
-
- Example: To add 22 + 15
-
- a. type 22 first number
- b. press (<-') 22 is pushed on to the
- stack
- c. type 15 second number
- d. press (+) perform function
-
- Keystroke Display Stack 1
- 22 22 0.
- (<-') 22 22
- 15 15 22
- (+) 27 0.
-
- As you can see by the example the first
- number was temporarily stored in stack
- until it was needed. The use of the
- stack for the storage of numbers or
- partial results of calculations is a
- powerful feature of RPN logic.
-
- Before continuing to the next section,
- press the tab key (|<-) and the back space
- key (<--). These keys will clear the
- stack and display registers respectively.
-
- In the previous example you will note
- that we had the value of 22 in the display
- register and in stack 1 after the second
- operation. We can make use of the 22 in
- the display register instead of overwrit-
- ing it with 15. By pressing the (+) key
- instead of entering 15 the number is
- doubled to 44.
-
-
-
-
-
- Programmer's Calculator Page 9
-
-
- Example: Double the number 22
-
- Keystroke Display Stack 1
- 22 22 0.
- (<-') 22 22
- (+) 44 0.
-
- Try out the following calculations before
- going on to chain calculations.
-
- 1. 22 x 25 = 550
- 2. 20 - 15 = 5
- 3. 20 / 4 = 5
- 4. 5^3 = 125
- 5. 5^1/3 = 1.7099759...
-
-
- Chain Calculations
-
- Long operations using multiple numbers
- are performed easily using RPN logic. Long
- calculations are broken down into smaller
- two register operations and the inter
- mediate result of each operation is stored
- in the stack where it cam be combined with
- the results of other operations. PC
- calculator allows up to four intermediate
- results to be stored in the stack.
-
- The result of an operation on the two
- numbers is in the display register. This
- result may then be used in a single
- register function or pushed on the stack
- and later combined with other numbers. To
- perform a calculation with the results of
- the first calculation and another number,
- simply enter the next number and perform
- the calculation. When you enter the next
- number the result of the first calculation
- is automatically pushed form the display
- register into the stack 1 register. You
-
-
-
-
-
- Programmer's Calculator Page 10
-
-
- now have the result of the first calcu-
- lation in stack 1 register and the new
- number in the display register. To
- complete the calculation press the desired
- function key.
-
- Example: Calculate the equation (22 + 5) x 10
-
- With the calculation of any equation,
- always perform the operation in the inner
- most level of parenthesis first, Then work
- you way to the outer levels of parentheses.
-
- a. type 22 fist number
- b. press (<-') push 22 in stack
- c. type 5 second number
- d. press (+) perform addition
- e. type 10 enter next number result
- of first operation (27)
- automatically pushed on
- the stack
- f. press (*) perform multiplication,
- result in the display
- register
-
- Keystroke Display Stack 1
- 22 22 0.
- (<-') 22 22
- 5 5 22
- (+) 27 0.
- 10 10 27
- (x) 270 0.
-
-
-
-
-
-
- Programmer's Calculator Page 11
-
-
- Try the following operations before
- continuing. If you do not get the correct
- results review the section again.
-
- (23 + 8) x 15 = 465
- ((4 x 16).5) x 10 = 320
- (1,234.43 / 55) x 2 = 44.8883636...
-
-
- More complicated problems are solved
- by temporarily storing the intermediate
- results of each operation in the stack
- until needed.
-
- Example: To solve (22 + 15) x (32 / 2)
-
- The results of the operation in each set
- of parenthesis is calculated. The results
- of the two intermediate calculations serve
- as input values for the final calculation.
-
- Keystroke Display S1 S2
- 22 22 0. 0.
- (<-') 22 22 0.
- 15 15 22 0.
- (+) 37 0. 0.
- 32 32 37 0.
- (<-') 32 32 37
- 2 2 32 37
- (/) 16 37 0.
- (*) 592 0. 0.
-
-
-
- FUNCTIONS
-
- In this section each function available
- on the PC calculator will be discussed.
-
-
-
-
-
-
- Programmer's Calculator Page 12
-
-
- The functions available on the calcu-
- lator are displayed in the lower left hand
- corner of the screen on the template.
- Since all of the functions can not be
- displayed at once the (F9) key is used to
- toggle between the two template.
-
- The keystroke used to invoke the
- function is illustrated in the template in
- an abbreviated form. For example the
- keystroke (Ctrl)-(F3) is representable by
- CF3. All key-strokes listed in this
- section separated by a dash [(Ctrl)-(F3)]
- should be pressed simultaneously.
-
- The symbol is the representation of the
- function as displayed on the template.
-
-
- General Functions
-
- Function Keystroke Symbol
-
- Add (+) +
- Subtract (-) -
- Multiply (*) *
- Divide (/) /
-
- Two register function
-
- Used to manipulate numbers in the display
- and the stack 1 register with the results
- in the display register. May also be used
- to manipulate display and a memory
- register with the results in the memory
- register.
-
-
-
-
-
-
-
-
-
- Programmer's Calculator Page 13
-
-
- Function Keystroke Symbol
-
- Square (F3) x^2
-
- Single register function
-
- Used to take the square of the number
- in the display register.
-
-
- Function Keystroke Symbol
-
- Square root (Alt)-(F3) x^1/2
-
- Single register function
-
- Used to take the square root of the
- number in the display register.
-
-
- Function Keystroke Symbol
-
- X to n (^)-(F3) Xn
-
- Dual register function
-
- Used to raise X to the Power n. X is the
- number in stack 1 register and n is the
- number in the display register.
-
-
- Function Keystroke Symbol
-
- X to 1/n (Ctrl)-(F3) X^1/n
-
- Dual register function
-
- Used to raise X to the power of 1/n. X is
- the number in the stack register and n is
- the number in the display register.
-
-
-
-
-
- Programmer's Calculator Page 14
-
-
- Function Keystroke Symbol
-
- Absolute value (Alt)-(F4) |x|
-
- Single Register Function
-
- Used to take the absolute value of the
- number in the display register.
-
-
- Function Keystroke Symbol
-
- Inverse (^)-(F4) 1/x
-
- Single register function
-
- Used to take the inverse of the number in
- the display register.
-
-
- Function Keystroke Symbol
-
- Change sign F4 +
-
- Single register function
-
- Used to change the sign of the display
- register.
-
-
- Logical Functions
-
- Function Keystroke Symbol
-
- And F5 AND
- Or F6 OR
- Xor F7 XOR
- Imp (^)-(F5) IMP
- Equ (^)-(F6) EQU
-
- Dual register function
-
-
-
-
-
-
- Programmer's Calculator Page 15
-
-
- The bits in the numbers in the display and
- stack 1 register are compared and the
- result placed in the display register.
- The bits are compared using the following
- tables.
-
- AND X Y Result
- 1 1 1
- 1 0 0
- 0 1 0
- 0 0 0
-
- OR X Y Result
- 1 1 1
- 1 0 1
- 0 1 1
- 0 0 0
-
- XOR X Y Result
- 1 1 0
- 1 0 1
- 0 1 1
- 0 0 0
-
- EQV X Y Result
- 1 1 1
- 1 0 0
- 0 1 0
- 0 0 1
-
- IMP X Y Result
- 1 1 1
- 1 0 0
- 0 1 1
- 0 0 1
-
-
-
-
-
-
- Programmer's Calculator Page 16
-
-
- Function Keystroke Symbol
-
- Not (F8) NOT
-
- Single register function
-
- The bits of the number in the display
- register are reversed according to the
- table.
-
- NOT X Result
- 0 1
- 1 0
-
-
- Memory Functions
-
- Function Keystroke Symbol
-
- Store F1 STO
-
- Dual Register Function
-
- Used to copy the contents of the display
- register into one of the memory registers.
- Requires a number (indicating the memory
- location) to be entered after pressing the
- F1 key. By entering one of the four
- arithmetic functions before entering the
- storage location, the contents of the
- memory location is add, subtracted,
- multiplied, or divided with the contents
- of the display register.
-
-
- Function Keystroke Symbol
-
- Recall F2 RCL
-
- Dual register function
-
-
-
-
-
- Programmer's Calculator Page 17
-
-
- Used to copy the contents of a memory
- register into the display register.
- Requires a number (indicating the memory
- location) to be entered after the F2 key
- is pressed.
-
-
- Function Keystroke Symbol
-
- Clear Memory (^)-(|<-) Clear memory
-
- Multiple register function
-
- Used to clear all of the memory registers
- in on operation. It uses the shift tab
- key.
-
-
- Stack Functions
-
- Function Keystroke Symbol
-
- Clear stack (->|) Clear stack
-
- Multiple register function
-
- The clear stack function allows you to
- clear the contents of the stack between
- calculations. It uses the tab key.
-
- Function Keystroke Symbol
-
- Rotate Stack (^)-(F2) R^
-
- Multiple register function
-
- The rotate stack function allows you to
- rotate the contents of the stack, Each
- time the (^)-(F2) is pressed, the stack
- will rotate one number.
-
-
-
-
-
- Programmer's Calculator Page 18
-
-
- Function Keystroke Symbol
-
- Swap X & Y (Alt)-(F2) X <-> Y
-
- Dual register Function
-
- The swap function exchanges the contents
- of the display register with the contents
- of the stack 1 register.
-
-
- MEMORY
-
- The Programmers Calculator has six
- memory registers (listed M1-M6) displayed
- across the top of the screen. This elimi-
- nates the need to write down the contents
- of the memory registers when performing
- calculations.
-
- Store
-
- Numbers in the display register may
- easily be copied into a memory register by
- first pressing (F1) and second entering
- the number of the memory register to
- receive the number. The process of
- copying a number into a memory register
- does not affect the contents of the dis-
- play register; however, the previous
- contents of the memory register are over-
- written.
-
- Example: Place 1345.6 into memory
- register (M2).
-
- Keystroke Display M2
- 1345.6 1,345.6 0.
- (F1) 2 1,345.6 1,345.6
-
-
-
-
-
-
- Programmer's Calculator Page 19
-
-
- Recall
-
- To retrieve numbers from a memory
- register, press (F2) followed by the
- number of the register that contains the
- number to be copied. The contents of the
- memory register are unaffected by the copy
- process. The contents of the display
- register are either overwritten or pushed
- into the stack depending upon the previous
- operation (see stack operations for the
- effect of an operation on the stack).
-
- Example: Retrieve the contents of M2.
-
- Keystroke Display M2
- 0. 1,345.6
- (F2) 2 1,345.6 1,345.6
-
-
- Arithmetic
-
- Contents of a memory register are
- affected when a number is stored or when a
- memory register is performed. The
- functions that may be used with memory
- registers are add, subtract, multiply,
- and divide. The results of calculations
- using a memory register and the display
- register are stored in the memory
- register.
-
- Example: Add the number 22 to the
- contents of M2.
-
- a. enter 22 number to be added
- b. press (F1) set up the store
- c. press (+) press key of operation
- to be performed
-
-
-
-
-
-
- Programmer's Calculator Page 20
-
-
- d. press 2 number of the memory
- register the number is
- added to
-
-
- Keystroke Display M2
- 22 22 1,345.6
- (F1) (+) 2 22 1,367.6
-
- Example: Subtract the number 67.6 from
- the contents of M2.
-
- Keystroke Display M2
- 67.6 67.6 1,367.6
- (F1) (-) 2 67.6 1,300
-
-
- Try out following examples.
-
- a. Store 500 into M1 and divide 20 into
- the register, answer is 25.
- b. Multiply the contents of M1 by 25,
- answer is 625
-
- To cancel a memory function before
- completion, press the enter key. You may
- then use the number in the display
- register as a function value or overwrite
- the number with a new number.
-
-
- Memory Display
-
- The contents of the memory register are
- displayed in single precision while the
- contents of the display register are
- displayed in double precision. This will
- not affect what you see in the memory
- register unless the numbers you are work-
- ing with are longer than 7 digits. Any
-
-
-
-
-
-
- Programmer's Calculator Page 21
-
-
- number longer than seven digits in memory
- will be displayed in scientific notation.
- Internally the computer stores the numbers
- in double precision so operations on the
- numbers are unaffected. When large
- numbers are retrieved from the memory they
- will be displayed in the format in which
- they were stored.
-
- Clear Memory
-
- The contents of memory may be cleared
- one register at a time or all of the
- registers at once.
-
- To clear one register store 0 into the
- register with the store function.
-
- To clear all of the registers at once
- press the shift and tab key simultan-
- eously. This will clear out all of the
- memory registers.
-
-
- STACK OPERATIONS
-
- The stack is the heart of the RPN logic
- calculator. By learning to use the stack
- efficiently you will be able to perform
- complex calculations easily and quickly.
-
-
- Push
-
- The stack is composed of four registers
- residing on top of each other labeled one
- to four. As you learned earlier numbers
- are pushed into the stack with the enter
- key (<-'). Continued pressing of the
- (<-') will continue to push the number
- deeper into the stack. This operation is
-
-
-
-
-
- Programmer's Calculator Page 22
-
-
- called pushing the stack. As you will see
- the first number pushed on to the stack
- will be the last number popped off the
- stack. The enter key is used to push the
- number in the display register onto the
- stack. When the number in the display
- register is the results of a numeric
- operation, the stack is automatically
- pushed when the next number is entered.
-
- When the stack is pushed the number in
- stack 4 register is discarded the number
- in stack 3 register takes its place. The
- numbers in each register are pushed up in
- the next highest register and finally the
- number in the display register is moved up
- into the stack 1 register.
-
- Example: Clear out the stack and try out
- the following keystrokes.
-
- 1 (<-') stack 4 0.
- stack 3 0.
- stack 2 0.
- stack 1 1
- display 1
-
- 2 (<-') stack 4 0.
- stack 3 0.
- stack 2 1
- stack 1 2
- display 2
-
- 3 (<-') stack 4 0.
- stack 3 1
- stack 2 2
- stack 1 3
- display 3
-
-
-
-
-
-
-
- Programmer's Calculator Page 23
-
-
- 4 (<-') stack 4 1
- stack 3 2
- stack 2 3
- stack 1 4
- display 4
-
- 5 stack 4 1
- stack 3 2
- stack 2 3
- stack 1 4
- display 5
-
- In the example we did not press (<-')
- after entering 5. Therefore the value of
- 5 was not pushed into the stack. If we
- press (<-') now the stack will be pushed
- and the number in stack 4 will disappear.
-
- (<-') stack 4 2
- stack 3 3
- stack 2 4
- stack 1 5
- display 5
-
-
- Pop
-
- When the stack is popped the operation
- is the reverse of the push. The contents
- of stack 1 register is moved into display
- register and the contents of stack 2
- register is moved into stack 1 register
- and so forth. are popped from the stack by
- popping the stack.
-
- Numbers are retrieved from the stack by
- popping the stack. All dual register
- functions that use the stack as the second
- register, automatically pop the stack.
- During the calculation the stack is popped
- and result left in the display register.
-
-
-
-
-
- Programmer's Calculator Page 24
-
-
- In fact the display register is an
- extension of the stack with one except-
- ion. When the stack is pushed the display
- register always retains the number that
- was pushed into the stack. You then have
- the option of using the number in the
- display register again or entering a new
- number. If you do not enter a new number
- then when you perform a function the
- number in the display register becomes one
- of the input values of the function.
-
- If you enter a new number the display
- is cleared to make room for the new
- number.
-
- Try the following examples.
-
- Example: Double the value of 45.
-
- Keystroke Display Stack 1
- 45 45 0.
- (<-') 45 45
- (+) 90 0.
-
- Example: Multiply 45 by 2
-
- Keystroke Display Stack 1
- 45 45 0.
- (<-') 45 45
- 2 2 45
- (*) 90 0.
-
-
- Clear Stack
-
- To clear the contents of the stack
- press the tab key. All of the stack
- registers will be set to zero, but the
- contents of the display register will be
- unaffected.
-
-
-
-
-
- Programmer's Calculator Page 25
-
-
- STACK MANIPULATION
-
- Programmer's Calculator provides two
- functions to manipulate numbers within the
- stack. These functions allow you to
- rearrange the contents of the stack for
- calculation.
-
- Rotate Stack
-
- The rotate stack function allows you
- to rotate the stack and the contents of
- the display register. The contents of the
- display resisters are moved into stack 4
- register and the stack is popped.
-
- Example: Enter the following sequence 1
- (<-') 2 (<-') 3 (<-') 4 (<-') 5
-
- Keystroke Register Contents
- stack 4 1
- stack 3 2
- stack 2 3
- stack 1 4
- display 5
-
- (^)-(F2) stack 4 5
- stack 3 1
- stack 2 2
- stack 1 3
- display 4
-
- Before continuing to the next section,
- press the tab key (|<-) and the back space
- key (<--). These keys will clear the
- stack and display registers respectively.
-
-
-
-
-
- Programmer's Calculator Page 26
-
-
- Swap X & Y
-
- The Swap X & Y function exchanges the
- contents of the display register and the
- stack 1 register. Press (Alt)-F2) and the
- two number are exchanged.
-
- Example: Enter the two numbers and swap
- the registers.
-
- Keystroke Display Stack 1
- 34 34 0.
- (<-') 34 34
- 15 15 34
- (Alt)-(F2) 34 15
-
-
- CONSTANT CALCULATIONS
-
- Whenever a number is in the stack 4
- register and the stack is popped, the
- contents of stack 4 is duplicated in stack
- 3 and stack 4 remains unchanged. This
- handy feature is useful in calculations
- that require constant value input.
-
- Example: Enter the following 4 (<-') 2
- (<-') 3 (<-') 4 (<-').
-
- Keystroke Registers Contents
- stack 4 4
- stack 3 2
- stack 2 3
- stack 1 4
- display 4
-
- (+) stack 4 4
- stack 3 4
- stack 2 2
- stack 1 3
- display 8
-
-
-
-
-
- Programmer's Calculator Page 27
-
-
- (+) stack 4 4
- stack 3 4
- stack 2 4
- stack 1 2
- display 11
-
- (+) stack 4 4
- stack 3 4
- stack 2 4
- stack 1 4
- display 13
-
- (*) stack 4 4
- stack 3 4
- stack 2 4
- stack 1 4
- display 52
-
- (*) stack 4 4
- stack 3 4
- stack 2 4
- stack 1 4
- display 208
-
-
- RANGES
-
- Input values Numbers entered into Pro-
- grammers Calculator may be up to 16 digits
- in length. The program does not support
- the input of numbers in scientific
- notation.
-
- Calculated Values Numbers generated by
- calculation may range from 2.9E-39 to
- 1.7E-38. Any number generated outside of
- that range will cause an "Out of Range"
- error message to be displayed.
-
- Logical Values Operations using the
- logical functions will work on integer
-
-
-
-
-
- Programmer's Calculator Page 28
-
-
- numbers from -32,768 to 32,767.
- Attempting to use invalid numbers will
- cause an error message to be displayed.
-
-
-
- ERROR MESSAGES
-
- The calculator program will display
- error messages for illegal operations.
- These messages are displayed just above
- the display register. The error message
- will be display until the next
- keystroke. The number in the display
- register may be used with any function.
- The number will be overwritten if you
- attempt to enter a new number without first
- pushing the number on the stack.
-
- If you continue to get error prompts
- check with the manual for correct proced-
- ures.
-
- Beep: The computer will beep if you attempt
- to enter an incorrect keystroke. Check
- the manual to determine the correct
- procedure.
-
- Out of Range: This prompt will be display-
- ed if you attempt to preform an operation
- with a number that is out of the range of
- the program.
-
- Division By Zero: This prompt is displayed
- if you attempt to divide zero into any
- number.
-
- Illegal Function: Any function or combin-
- ation of keystrokes that is unknown to the
- program will cause the prompt to be
- displayed.
-
-
-
-
-
- Programmer's Calculator Page 29
-
-
- CONVERSION PROGRAM
-
- NUMBER FORMATS & RANGES
-
- The format of the number entered in the
- Conversion Program varies depending upon
- the type of number being entered (hexadec-
- imal, decimal, etc.). A beep will be
- sounded if you attempt an invalid
- character.
-
- Numbers that are out of allowable
- ranges will cause a appropriate error
- message displayed at the bottom of the
- screen.
-
- Decimal: Any digits between 0 and 9 inclu-
- sive are valid for entering decimal
- numbers. Negative signs may be entered
- when entering negative numbers. The sign
- is entered first followed by the number.
-
- The range of valid decimal numbers is
- -32,768 to 1,048,575.
-
-
- Hexadecimal: Any digits between 0 and 9
- inclusive and characters between A and F
- inclusive are valid for entering hexadec-
- imal numbers. Letters may be upper or
- lower case.
-
- The range of valid hexadecimal numbers
- is 00000 to FFFFF.
-
- Binary: Only 0 and 1 are used to form
- valid binary numbers. Binary numbers must
- be entered in groups of four.
-
- The range of valid binary numbers is
- 0000 to 1111 1111 1111 1111 1111.
-
-
-
-
- Programmer's Calculator Page 30
-
-
- Octal: Any digits between 0 and 7
- inclusive are valid for entering octal
- numbers.
-
- The range of valid octal numbers is 0
- to 3,777,777
-
-
- CONVERTING
-
- Converting number is a simple task. At
- the top of the screen is a menu of the
- conversion options.
-
- 1 Decimal 4 Octal
-
- 2 Hexadecimal 5 2's Complement
-
- 3 Binary F10 Calculator
-
- Enter one of the selection between 1 and
- 5. The "Enter Choice" prompt in the
- middle of the screen will be replaced by a
- prompt corresponding to the selection.
- Enter the number to be converted then
- press the enter key (<-').
-
- The conversion will be displayed at the
- bottom of the screen next to the
- appropriate type. The prompt will be
- replaced with the "Enter Choice" prompt
- and you are ready to convert the next
- number.
-
- Numbers entered in correctly may be
- corrected by entering the backspace key.
- Press the key once and the last character
- entered is deleted.
-
-
-
-
-
-
- Programmer's Calculator Page 31
-
-
- If you enter a choice and decide you do
- not want to enter a number of that type
- then simply press (<-') and the current
- prompt will be replaced by the "Enter
- Choice" prompt.
-
- Example: Convert decimal 798
-
- a. press 1
- b. read prompt
- c. type 798
- d. press (<-')
-
- Results:
-
- Decimal 798 Binary 0011 0001 1110
-
- Hexadecimal 31E Octal 1,436
-
-
- 2'S COMPLEMENT
-
- To calculate the 2's complement press 5
- at the "Enter Choice" prompt. The numbers
- at the bottom of the screen will be recal-
- culated and the 2's complement of the
- number displayed.
-
- Press 5 again and the original numbers
- will appear again. The 5 will toggle
- between regular notation and 2's
- complement.
-
- 2's complement will only work on
- numbers in the range of -32,768 to
- 32,767. Attempting to calculate the
- complement of a number outside this range
- will result in an error message.
-
-
-
-
-
- Programmer's Calculator Page 32
-
-
- ERRORS
-
- The program responds to four types of
- errors. For invalid keystrokes the
- program will beep. For the rest of the
- errors the program will respond with
- visual responses at the bottom of the
- screen. The error message will remain
- resident on the screen until the next
- keystroke.
-
- Too Few Digits (Enter in groups of four):
- This prompt will be displayed if the you
- attempt to enter a binary number with an
- invalid number of digits.
-
- Out of 2's Complement Range -32768 to
- 32767: This message is displayed if you
- attempt perform a 2's complement that is
- out of range.
-
- Out of Range: This message is displayed
- for any number entered that is out of
- range.
-
-
- PROMPTS
-
- The following prompts are displayed
- according to the menu item selected.
-
- Decimal: Enter Decimal Number (-32,768 to
- 1,048,575)
-
- Hexadecimal: Enter Hexadecimal Number (0
- to FFFFF)
-
- Binary: Enter Binary Number (20 Digits
- Max)
-
- Octal: Enter Octal Number (0 to 3,777,777)
-